package tom.happydog.controller;

import tom.happydog.entity.User;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;

//2.定义controller 声明bean
//2.1使用@controller定义bean
@Controller
@RequestMapping("/user")
public class UserController {
//    2.2设置当前操作的访问路径
    @RequestMapping("/save")
//2.3设置当前当前操作的返回值类型
    @ResponseBody
    public String save(User user, MultipartFile file){
        System.out.println("user save...");
        System.out.println("user save...user ==> "+ user);
  //文件不知道怎么使用
        return "{'module':'springmvc'}";
    }

    @RequestMapping("/delete")
    @ResponseBody
    public void delete(User user){
        System.out.println("sssss");
    }


}

//3.加载bean，做springmvc的配置
